//差分 小明的彩灯
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

const int N=1e6;
ll a[N];
ll d[N];
ll prefix[N];
int main()
{
	int n,q;
	cin >> n >> q;
	for(int i =1;i<=n;i++)
		cin >> a[i];
	
	for(int i = 0;i<=n;i++)
		d[i]=a[i]-a[i-1];
	
	for(int i = 1;i<=q;i++)
	{
		ll l,r,x;
		cin >>l>>r>>x;
		d[l]+=x;
		d[r+1]-=x;
	}
	
	for(int i = 1;i<=n;i++)
	{
		prefix[i] = prefix[i-1] + d[i];
		a[i] = prefix[i]<0 ? 0 : prefix[i]; 
	}
	for(int i = 1;i<=n;i++)
		cout << a[i] <<' ';
	return 0;
}
